package ControlLayer;

import ModelLayer.*;
/**
 * Write a description of class CDHandling here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class CDHandling
{
    private CDCollection cdCont;
    /**
     * Constructor for objects of class CDHandling
     */
    public CDHandling()
    {
        // initialise instance variables
    cdCont = CDCollection.getInstance();
    
     
    }
    
    public CD findCD(String title)
    {
        return cdCont.findCD(title);
    }
    public void createCDDeveloper2(int nr, String title)
    {
        CD cdObj = new CD(nr, title);
        cdCont.addCD(cdObj);
    }
    public void addTrack(String title, String track, int length)
    {
       
        CD cdObj = cdCont.findCD(title);
        if(cdObj != null)
        {
            cdObj.addTrack(track, length);
        }
        
        
    }
}
